package com.hospital.controller;

import com.hospital.entity.SickBed;
import com.hospital.entity.User;
import com.hospital.service.intf.SickBedService;
import com.hospital.vo.PageBean;
import com.hospital.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/sickbed/")
public class SickBedController {
    @Autowired
    private SickBedService service;

    @PostMapping("add.do")
    public R add(SickBed sickbed){
        return service.add(sickbed);
    }
    //修改
    @PostMapping("update.do")
    public R update(SickBed sickbed){
        return service.update(sickbed);
    }
    //删除
    @GetMapping("del.do")
    public R del(int id){
        return service.delete(id);
    }
    //查询
    @GetMapping("page.do")
    public PageBean page(Integer id, int page, int limit){
        return service.selectPage(id, page, limit);
    }

    @PostMapping("delids.do")
    public R dels(int[] ids){
        return service.delIds(ids);
    }
}
